// Json 验证器
class Jv {
    constructor() {

    }

    validator(data, options) {
        const errors = [];

        for (const key in options) {
            const rules = [];

            for (let j = 0; j < rules.length; j++) {
                let item = rules[j];
                let rule;

                if (typeof item == 'string') {
                    rule = item;
                }

                switch (rule) {
                    case 'required':

                        errors.push(options);

                        break;

                        break;

                    default:
                        break;
                }

            }
        }

        return errors;
    }
}

// Jv.validator(data, {
//     'username': { name: '用户名称', rules: ['required'] }
// })

module.exports = new Jv();
